﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Dispatch.aspx.cs" Inherits="Services_Dispatch" %>
<html>
<head>
<title>添加维修单</title>
<link href="../css/adminCss.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/rl.js"></script>
<script type="text/javascript" src="../js/submit.js"></script>
<script type="text/javascript">
var xmlHttp; 
var ajaxresponsevalue;
function createXMLHttpRequest() { 
    if (window.ActiveXObject) { 
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); 
    } 
    else if (window.XMLHttpRequest) { 
        xmlHttp = new XMLHttpRequest(); 
    } 
} 
 function startRequest() {  
    if(document.getElementById('txtGuestName').value!="" || document.getElementById('txtPhone').value!="" )
    {
        var Url="";
        if(document.getElementById('txtGuestName').value!="")
            Url='Data.aspx?GuestName='+escape(document.getElementById('txtGuestName').value)
        else if(document.getElementById('txtPhone').value!="")
            Url='Data.aspx?Guesttel='+escape(document.getElementById('txtPhone').value)
            
    document.getElementById('Msg').innerHTML = "正在获取客户信息...";
    document.getElementById("Msg").style.visibility="visible";
    createXMLHttpRequest(); 
    xmlHttp.onreadystatechange = handleStateChange; 
    xmlHttp.open("POST",Url, true);
    xmlHttp.send(null); 
    }
}
function handleStateChange() { 
    if(xmlHttp.readyState == 4) { 
        if(xmlHttp.status == 200) {
            getDownListData(xmlHttp.responseText,0);	
      } 
    } 
} 
    
//查询客户资料信息
function getDownListData(GuestName,flag)
{
var pos,str,para,parastr,tempstr1; 
tempstr=""; 
str = window.location.href; 
pos = str.indexOf("?") 
parastr = str.substring(pos+1);  
if(GuestName!="" || flag==1)
{//alert(GuestName);
   var result =window.showModalDialog("selectGuestwc.aspx?GuestName="+escape(GuestName)+"&"+parastr,"","dialogWidth:800px;dialogHeight:600px;scroll:yes;help:0;status:no;");
     if(result!=undefined)
     {
     document.getElementById("txtGuestName").innerText=result.split(',')[0];
     document.getElementById("txtManName").innerText=result.split(',')[1];
     document.getElementById("txtPhone").innerText=result.split(',')[2];
     document.getElementById("txtAddress").innerText=result.split(',')[3]; 
     document.getElementById("txtcomitype").innerText=result.split(',')[4];
     document.getElementById("txtBrand").innerText=result.split(',')[5];
     document.getElementById("txtSpeci").innerText=result.split(',')[6]; 
     document.getElementById("txtDispTime").innerText=result.split(',')[7]; 
      }
      else
      {
        alert('您未选择客户信息！');
      }
}
   
    
document.getElementById("Msg").style.visibility="hidden";

}

function account()
{
    var wxfy=document.getElementById("txtwxfy").value;
    var bjfy=document.getElementById("txtbjfy").value;
    var clfy=document.getElementById("txtclfy").value;
    var qtfy=document.getElementById("txtqtfy").value;
    if(wxfy==""||bjfy==""||clfy==""||qtfy=="")
    {
        document.getElementById("txtzr").value="";
    }
    else if(isNaN(wxfy))
    {
        alert('数量格式有误，必须由数字组成!');
        return false;
    }
    else if(isNaN(bjfy))
    {
        alert('数量格式有误，必须由数字组成!');
        return false;
    }
    else if(isNaN(clfy))
    {
        alert('数量格式有误，必须由数字组成!');
        return false;
    }
    else if(isNaN(qtfy))
    {
        alert('数量格式有误，必须由数字组成!');
        return false;
    }
    else if(wxfy!=""&&bjfy!=""&&clfy!=""&&qtfy!=""&&!isNaN(wxfy)&&!isNaN(bjfy)&&!isNaN(clfy)&&!isNaN(qtfy))
    {
        document.getElementById("txtzr").value=Number(wxfy)+Number(bjfy)+Number(clfy)+Number(qtfy);
        
    }
}
     
</script>
<link href="../js/loading.css" rel="stylesheet" type="text/css" />
</head>
<script type="text/javascript" src="../js/loading.js" charset="gb2312"></script>
<body>
    <form id="form1" runat="server" onSubmit=" checknull(this)">
        <table width="99%" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td width="20" height="22"><img src="../images/module.gif" width="20" height="22"></td>
                <td style="width: 335px"><asp:Label ID="lblPath" runat="server"></asp:Label> >> 添加维修单</td>
                <td align="right"><font color="red"> [ <a href="javascript:location.href=document.referrer;" class="F_red"><font color="red">返回</font></a> ]</font></td>
            </tr>
        </table>
        <table width="99%" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td bgcolor="#3CB6E5" height="5px">
                </td>
            </tr>
        </table>
        <table width="99%" border="0" cellpadding="1" cellspacing="1" class="tabGg">
            <tr>
                <td  colspan="4" bgcolor="#FFFFFF" style="color: #3366ff; text-align: left">
                    <table width="100%" border="0">
                        <tr>
                            <td align="center" style="text-align: left;" colspan="2">
                                <asp:Label ID="lblMsg" runat="server" Text="业务编号：" ForeColor="Red"></asp:Label>
                                <asp:Label ID="lblDh" runat="server"></asp:Label>&nbsp;</td>
                        </tr>
                    </table>                    </td>
            </tr>
             <tr bgcolor="#3CB6E5" height="5px">            </tr>
            <tr><td bgcolor="#ffffff" colspan="4" height="22" style="color: #3366ff; text-align: left">
                <strong>客户基本信息</strong></td></tr>
            <tr>
                <td width="15%" height="25" bgcolor="#ffffff" class="r_bg">客户名称：</td>
                <td bgcolor="#ffffff" class="right_bg F_red">
                    <asp:TextBox ID="txtGuestName" runat="server" CssClass="input1" onkeyup="startRequest()" ondblclick="getDownListData(this.value,1)" check_null="客户名称不能为空"></asp:TextBox><div id="Msg" style="position: absolute; width: 120px; height: 20px; z-index: 1;border: 1px solid #ff0000; background-color: #FEEED3; layer-background-color: #FEEED3;filter: alpha(opacity=50); visibility: hidden;"></div>*双击选择</td>
                <td bgcolor="#ffffff" class="r_bg" width="14%">联 系 人：</td>
                <td bgcolor="#ffffff" class="right_bg" width="37%"><asp:TextBox ID="txtManName" runat="server" CssClass="input1"></asp:TextBox></td>
            </tr>
            <tr>
                <td width="15%" height="26" bgcolor="#FFFFFF" class="r_bg">联系电话：</td>
                <td bgcolor="#FFFFFF" class="right_bg"><asp:TextBox ID="txtPhone" runat="server" CssClass="input1" check_null="联系电话不能为空"  onkeyup="startRequest()"></asp:TextBox></td>
                <td width="14%" bgcolor="#FFFFFF" class="r_bg">客户地址：</td>
                <td width="37%" bgcolor="#FFFFFF" class="right_bg"><asp:TextBox ID="txtAddress" runat="server" CssClass="input1" check_null="客户地址不能为空"></asp:TextBox></td>
            </tr>
            <tr bgcolor="#3CB6E5" height="5px">            </tr>
            <tr><td colspan="4" style="color: #3366ff; text-align: left" height="22" bgcolor="#ffffff">
                <strong>商品基本信息</strong></td></tr>
            <tr>
                <td height="28" bgcolor="#FFFFFF" class="r_bg">商品类型：</td>
                <td bgcolor="#FFFFFF" class="right_bg">
                    <asp:TextBox ID="txtcomitype" runat="server" CssClass="input1" ></asp:TextBox></td>
                <td bgcolor="#FFFFFF" class="r_bg">商品品牌：</td>
                <td bgcolor="#FFFFFF" class="right_bg">
                    <asp:TextBox ID="txtBrand" runat="server" CssClass="input1" ></asp:TextBox></td>
            </tr>
            <tr>
                <td height="24" bgcolor="#FFFFFF" class="r_bg">规格型号：</td>
                <td bgcolor="#FFFFFF" class="right_bg" >
                   <asp:TextBox ID="txtSpeci" runat="server" CssClass="input1" ></asp:TextBox></td>
                <td bgcolor="#FFFFFF" class="r_bg" >购买日期：</td>
                <td bgcolor="#FFFFFF" class="right_bg">
                    <asp:TextBox ID="txtDispTime" runat="server" CssClass="input1" onclick="SelectDate(this.id)" ></asp:TextBox></td>
            </tr>
            <tr>
                <td rowspan="2" bgcolor="#FFFFFF" class="r_bg">随机附件：</td>
                <td rowspan="2" bgcolor="#FFFFFF" class="right_bg" ><asp:TextBox ID="txtsjfj" runat="server" CssClass="input1"></asp:TextBox></td>
                <td bgcolor="#FFFFFF" class="r_bg" >序列号1：</td>
                <td bgcolor="#FFFFFF" class="right_bg"><asp:TextBox ID="txtxlh1" runat="server" CssClass="input1" ></asp:TextBox></td>
            </tr>
            <tr>
              <td bgcolor="#FFFFFF" class="r_bg" >序列号2：</td>
              <td bgcolor="#FFFFFF" class="right_bg"><asp:TextBox ID="txtxlh2" runat="server"  CssClass="input1"></asp:TextBox></td>
            </tr>
            
            <tr bgcolor="#3CB6E5" height="5px">            </tr>
            <tr>
                <td height="22"   style="color: #3366ff; text-align: left; font-weight: bold;" colspan="4" bgcolor="#ffffff">要求服务信息</td>
            </tr>
            <tr>
                <td bgcolor="#ffffff" class="r_bg">维修日期：</td>
                <td bgcolor="#ffffff" class="right_bg" ><asp:TextBox ID="txtMaintDate" runat="server" CssClass="input1" check_null="维修日期不能为空"  onclick="SelectDate(this.id)"></asp:TextBox></td>
                <td bgcolor="#ffffff" class="r_bg">维 修 人：</td>
                <td bgcolor="#ffffff" class="right_bg"><asp:DropDownList ID="ddlName" runat="server" ></asp:DropDownList></td>
            </tr>
            <tr>
                <td height="22" bgcolor="#FFFFFF" class="r_bg">报修故障：</td>
                <td bgcolor="#FFFFFF" class="right_bg" ><asp:TextBox ID="txtMaintTrouble" runat="server" CssClass="input1" Width="200px"></asp:TextBox></td>
                    <td bgcolor="#ffffff" class="r_bg">预约时间：</td>
                <td bgcolor="#ffffff" class="right_bg" ><asp:TextBox ID="txtBespeakDate" runat="server" CssClass="input1" check_null="预约日期不能为空"  onclick="SelectDate(this.id)"></asp:TextBox></tr>
            <tr>
                <td bgcolor="#FFFFFF" class="r_bg">                
                    <asp:HiddenField ID="hidModuid" runat="server" />
                </td>
                <td colspan="3" bgcolor="#FFFFFF" class="right_bg"><asp:Button ID="btnAdd" CssClass="submit" runat="server" Text=" 提交 " OnClick="btnAdd_Click" OnClientClick='return checknull(this.form)'/>
                    </td>
            </tr>
        </table>
    </form>
</body>
</html>
